Testing applications with a defined input format

ABSTRACT

A system and method are provided for testing the performance of applications. By way of example only, the method may include training a neural network with documents containing text elements that are arranged in accordance with a defined format and using the neural network to determine the predictability of the value of individual text elements within a test document. When the neural network indicates that the value of a text element is unlikely, the value may be modified and the modified document may be used to test an application that processes documents in accordance with the defined format.

BACKGROUND

Fuzz testing provides a technique for testing computer programs with theuse of randomized input. For instance, fuzz-based testing techniques maybe used to generate and modify test inputs, including file documents,that conform with a defined text format such as HyperText MarkupLanguage (HTML), Portable Document Format (PDF) or Cascading Style Sheet(CSS) language. When the document is provided to an application forprocessing, the application may be monitored for unexpected orundesirable behaviors, such as crashes or exposing data to unauthorizedaccess.

Certain generation-based fuzz techniques may randomly generate or changetest documents based on a manually-specified grammar. For example, therequirements of a defined format may be written as a set of computerinstructions that generate or change a sequence of random values suchthat the sequence remains fully consistent with the format. Complicatedformats may make it difficult and cumbersome to create computerinstructions that fully implement the grammar, e.g., are capable ofiterating through all of the requirements or iterating through therequirements in unexpected ways. Moreover, small changes to therequirements of the defined format may require substantial changes tothe computer instructions.

Certain mutation-based fuzz techniques may make small changes to anexisting test document, analyze the results and then repeat the process.By way of example, a mutation-based fuzz technique may involve:selecting a document that conforms with a defined text format; mutating(e.g., modifying) the selected document by randomly changing characters(e.g., by bit flipping or byte incrementing), deleting characters,adding characters, or swapping strings of characters; processing thedocument using the application being tested; scoring the document basedon its coverage (e.g., the identity of routines and the number of uniquelines of code that were executed in the application as a result ofprocessing the document) and; using the score as a fitness function in agenetic algorithm or the like to determine whether the document shouldbe further mutated and scored. Documents that result in crashes or allowpotentially malicious actions (e.g., buffer overflow) may also beselected for additional mutation and testing. Although mutation-basedfuzz techniques are effective for certain formats such as media formats,they may be less effective than generation-based fuzz techniques whenused in connection with complicated text formats.

SUMMARY

One aspect of the technology relates to a method that includes:receiving a sequence of values of text elements; determining, with oneor more computing devices, a score for a text element value of thesequence, where the score is related to the probability of a particulartext element value equaling one or more given values, and where saidprobability is based on sequences of text element values that areconsistent with a defined format, comparing, with the one or morecomputing devices, the score to a threshold; when the score is below athreshold, modifying, with the one or more computing devices, the valueof the text element to form a modified sequence of text element values;processing, with the one or more computing devices, the modifiedsequence of text element values with a set of instructions; and testing,with the one or more computing devices, a performance characteristic ofthe set of instructions when the set of instructions process themodified sequence of text element values.

Another aspect of the technology relates to a system that includes oneor more computing devices and a memory storing instructions executableby the one or more computing devices, where the instructions include:receiving an initial sequence of text elements having values;determining a first score for the value of a first text element of theinitial sequence, wherein determining a score with respect to the valueof a particular text element in a particular sequence of text elementsis related to how frequently the value of the particular text elementfollows same or similar sequences of text element values that areconsistent with a defined format; determining a second score for thevalue of a second text element of the initial sequence, wherein there isa third text element between the first and second text elements in theinitial sequence; comparing the first and second scores to a threshold;when the first and second scores are above the threshold, generating asecond sequence of text elements having values, where the value of afirst text element in the second sequence equals the value of the firsttext element in the initial sequence, the value of a second text elementin the second sequence equals the value of the second text element inthe initial sequence, the value of a third text element in the secondsequence is different from the value of the third text element in theinitial sequence, and the third text element is in between the first andsecond text elements in the sequence; processing, with the one or morecomputing devices, the second sequence of text elements with anapplication; and testing, with the one or more computing devices, aperformance characteristic of the application when the applicationprocesses the modified sequence of text element values.

Yet another aspect of the system relates to a system of one or morecomputing devices and a storing instructions executable by the one ormore computing devices, where the instructions include: receiving adocument containing a sequence of text characters; determining a scorefor each of a plurality of characters of the document, wherein the scoreof a character is determined based on the value of the character, thevalue of one or more preceding characters in the document, and a machinelearning component trained with sequences of characters conforming withthe defined format; when the score of a character below a threshold,associating the character with a set of characters eligible formodification; modifying at least one of the characters in the set ofcharacters; and after modifying at least one of the characters in theset of characters, measuring the performance of an application as theapplication processes the document.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a functional diagram of a system in accordance with aspects ofthe disclosure.

FIG. 2 is a flow diagram in accordance with aspects of the disclosure.

FIG. 3 is a flow diagram of the training of a neural network inaccordance with aspects of the disclosure.

FIG. 4 is an example of a test document.

FIG. 5 is an example of likelihood values of text elements.

FIG. 6 is an example of a test document.

FIG. 7 is an example of a test document modified in accordance withaspects of the disclosure.

FIG. 8 is an example of performance characteristics of an application.

FIG. 9 is an example of performance characteristics of an application.

FIG. 10 is a flow diagram in accordance with aspects of the disclosure.

DETAILED DESCRIPTION

Overview

The technology relates to generating a sequence of text element valuesthat may be used to measure the performance of instructions for acomputing device. By way of example and as shown in FIGS. 1 and 2, asystem 100 of one or more computing devices 110 and 120 may be used toidentify documents that are consistent with a defined format (block210), train a recurrent neural network with the documents (block 220),use the network to identify the predictability of text elements in atest document (block 230), modify the test document based on thepredictability of the text elements (block 240), test an applicationwith the test document (block 250) and, depending on the results of thetest, repeat the process of identifying predictability, modifying thetest document and testing the application.

In that regard and as shown in FIG. 3, the system may identify documentsthat are consistent with a particular defined format and use thosedocuments to train a machine learning component. For instance, thesystem may train neural network 340 with a corpus 330 of documents 320that were retrieved from web servers 310-12.

As shown in FIGS. 4-6, the system may use the machine learning componentto identify the predictability of text elements within a test document.For instance, neural network 340 may return score values that indicatethe predictability of the characters within portion 611 (e.g., string410) is relatively high, the predictability of the first character inportion 610 is relatively moderate, and the predictability of thecharacters in portion 630 are relatively low. As a result, the systemmay assign relatively high scores to portions 610 and 630 and relativelylow scores to portion 611.

The system may modify the identified portions based on the text elementscores returned by the neural network. For example and as shown in FIG.7, one or more of the characters in portions 610 and 630 may be changed,deleted or added.

The modified document may be provided to a set of computer instructionsfor testing. By way of example and as shown in FIG. 8, modified testdocument 700 may be provided to a browser application for testing andthe system may measure various characteristics of the browser'sperformance, such as how many of the browser's instructions wereexecuted or failed as a result. The system may determine a test scorebased on the performance and, as shown in FIG. 9, the modified documentmay be analyzed, modified, tested and scored again. If the test scoreincreases, the document may be continuously analyzed, modified, testedand scored until its test score does not increase.

Example Systems

Systems such as those described above may include one or more computingdevices. For instance, FIG. 1 provides the example of system 100, whichincludes computing devices 110 and 120. The computing devices areconfigured to accept information, perform operations based on thatinformation, and take an action or provide additional information inresponse. The computing devices may be, or include, a processor that iscapable of receiving one or more electrical signals representinginformation expressed as a numerical value as input, determine anumerical value based on the input in accordance with instructions, andprovide one or more electrical signals that represent the determinednumerical value as output. Device 110 includes processor 111, which maybe a commercially available central processing unit (CPU),application-specific integrated circuit (ASIC) or field-programmablegate array.

The instructions used by a computing device include any set of one ormore instructions that are accessed and executed by the computingdevice. By way of example, device 110 stores values representinginstructions 113 and processor 111 is able to access those values andperform, or cause other components of device 110 or system 100 toperform, operations associated with those instructions. For example,device 110 instructions 113 may include machine code (e.g., machine codestored in object code) that is capable of being executed directly byprocessor 111. Alternatively or in addition, instructions 113 may bestored in a format that requires additional processing before execution,such as a script or collection of independent source code modules thatare interpreted on demand. An operation expressed as a singleinstruction in one format may correspond with multiple instructions inanother format, e.g., executing a single command in script may requirethe execution of multiple machine code instructions. If the computingdevice has an operating system, the instructions may includeinstructions that run in, above, or below the operating system layer.For instance, some of the operations described herein may involve theexecution of instructions provided by the Chrome or Android operatingsystems provided by Google, the Windows operating system provided byMicrosoft, or the macOS, OS X or iOS operating systems provided byApple.

The instructions may be stored in a memory. For instance, instructions113 are stored in memory 112. The memory may be any component that iscapable of storing information on a non-transitory storage medium thatcan be read by a computing device, e.g., registers provided on the samesubstrate as processor 111, volatile memory such as RAM (random-accessmemory), non-volatile memory such as flash memory, e.g. a Secure Digital(SD) card, a hard-disk drive, a solid-state drive, optical storage, ortape backups. Device 110, processor 111 and memory 112 are configured sothat processor 111 can read, modify, delete and add values stored inmemory 112. Memory may be configured to provide less access than theexample of memory 112, e.g, memory may be read-only.

Memory may store information that is used by, or results from, theoperations performed by the computing device. By way of example, memory112 stores data 114, which includes values that are retrieved or storedby processor 111 in accordance with instructions 113, such asinformation that is required or determined by device 110 when performingsome of the operations described herein. Values stored in memory 112 maybe stored in accordance with one or more data structures. For instance,a value stored in memory 112 may represent a single numeric value (e.g.,a binary number, an integer, a floating point number, a Unicode valuerepresenting a single character of text, digit or punctuation mark, or avalue representing a single machine code instruction), a set of multiplenumeric values (e.g., an array of numbers, a string of text characters,XML-formatted data, or a file), or information from which values to beprocessed in accordance with instructions 113 may be obtained (e.g., areference to a value stored at a remote location or a parameter of afunction from which the required value is calculated).

A computing device may include components for receiving information fromthe physical environment surrounding the device and allow direct userinput to the computing device. Similar to device 110, device 120includes a processor 111, memory 112, instructions 113 and data 114.Device 120 also includes components that detect information relating tothe physical environment in which the component is disposed, and thisinformation may include information provided by user 150. Device 110includes a user input component 125 having circuitry and othercomponents configured to receive input from user 150, such asinformation provided tactilely (e.g., a mouse, keyboard, keypad, buttonor touchscreen). User input components may perform functions that arenot primarily directed to user input. By way of example, camera 127 maybe used to capture user commands (e.g., hand gestures) and other visualinformation (e.g., the visual characteristics of a mountain). Microphone126 may be used to capture user commands (e.g., verbal commands) andother audio information (e.g., the sound of a waterfall).

A computing device may include components for providing information viathe physical environment surrounding the device and provide outputdirectly to users. For example, a component may include circuitry thatoutputs visual, audio or tactile information to users of the device,such as display 130 (e.g., a computer monitor, a touch-screen, aprojector or another component that is operable to change a visualcharacteristic in response to a signal), speaker 128, or motor 126 tovibrate the device.

A computing device may include one or more components for communicatingwith other computing devices. By way of example, devices 110 and 120include circuitry (e.g., a network interface) connecting each device toa different node of communication network 190. Network 190 may becomposed of multiple networks using different communication protocols.For instance, when device 110 transmits information to device 120, theinformation may be sent over one or more of the Internet (e.g., via coreInternet routers in accordance with the Transmission Control Protocol(TCP) and Internet Protocol (IP)), a cellular network (e.g., inaccordance with the LTE (Long-Term Evolution) standard), a local network(e.g., an Ethernet or Wi-Fi network), and a Bluetooth connection. Adevice may provide information to a user via other devices, e.g., device110 may display information to user 150 by sending the information overnetwork 190 to device 120 for display on display 130. A computing devicemay also provide information to another computing device without the useof a network. By way of example, one computing device may outputinformation with a display and another computing device may detect thatinformation with a camera. Although only a few computing devices aredepicted in FIG. 1, the system may include a large number of computingdevices that are connected to the network at a large number of nodes.

Although FIG. 1 shows computing devices 110 and 120 as individualblocks, each of which contains its own processor and memory, theoperations described herein may involve a single computing device ormany computing devices, e.g., in the “cloud”. For example, variousoperations described below as involving a single computing device (e.g.,a single central processing unit (CPU) in a single server) may involve aplurality of computing devices (e.g., multiple processors in aload-balanced server farm). Similarly, memory components at differentlocations may store different portions of instructions 113 andcollectively form a medium for storing the instructions. By way offurther example, operations described as involving a plurality ofcomputing devices may be performed by a single computing device, e.g.,rather than sending data to device 110 for processing, device 120 mayprocess the data itself. Alternatively, device 120 may function as athin client wherein device 110 performs all or nearly all operationsthat are not directly related to receiving and providing information tousers via user input component 125 and display 130. Various operationsdescribed herein as being performed by a computing device may beperformed by a virtual machine. By way of example, instructions 113 maybe specific to a Windows server, but the relevant operations may beperformed by a Linux server running a hypervisor that emulates a Windowsserver. The operations may also be performed by a container, e.g., acomputing environment that does not rely on an operating system tied tospecific types of hardware.

In various examples described herein, device 110 is a server and devices120-21 are client devices. For instance, device 110 may be a server anddevice 120 may be a desktop (notebook) computer system, e.g., processor121 and memory 122 may be contained in a desktop personal computer,display 130 may be an external monitor connected to the personalcomputer by a cable, and user input component 125 may be an externalkeyboard that communicates with the computer via Bluetooth.Alternatively, device 120 may be a wireless phone with a touchscreenthat functions as both display 130 and user input component 125. Otherclient devices may include, by way of example, laptops, notebooks,netbooks, tablets, set-top boxes (e.g., a cable-television set-top boxconnected to a television) and wearable devices (e.g., a smartwatch). Inthat regard, a computing device may include other components that aretypically present in such devices or general purpose computers but arenot expressly described herein.

The system may also store documents having one or more text elements,e.g., a single character, a token (e.g., a sequence of charactersbetween delimiters within a document such as a word) or a sequence ofcharacters of a given length. The text elements may have values, e.g.,the value of a character may “a” or “*”.

The text element may be stored within a document as a sequence of valuesthat conform with a defined format, e.g., one or more requirementsregarding how text elements relating to certain types of informationshould be stored within a document. To the extent the defined format maybe considered a language, the requirements may be considered the grammarof the language. The requirements may relate to, by way of example only,the permissible text element values (e.g., UNICODE or ASCII), wherecertain types of information needs to be stored relative to thebeginning of the document (e.g., documents that comply with HTML version5 start with “<!DOCTYPE html>”), reserved keywords, and where certaintypes of information are stored relative to other types of information(e.g., the destination URL of a link on a webpage follows the keyword“href”). While most of the examples below focus on HTML for ease ofillustration, the system and operations described herein apply to otherdefined formats, including proprietary standards.

Example Methods

Operations in accordance with a variety of aspects of the method willnow be described. It should be understood that the following operationsdo not have to be performed in the precise order described below.Rather, various steps can be handled in different order orsimultaneously.

The system may identify preexisting samples of information arranged inaccordance with a selected defined format. For instance and as shown inFIG. 1, device 110 may use network 190 to access documents that arestored at sources 191 and are consistent with the defined format. By wayof example, as shown in FIG. 3, the system may retrieve a plurality ofweb pages formatted in accordance with HTML from a plurality of webservers 310-12. The web pages 320 collectively form a corpus 330 of HTMLdocuments.

The system may train a machine learning component with the samples ofthe defined format. In that regard, device 110 may store instructionsassociated with training a neural network, traversing the neuralnetwork, extracting data stored in connection with the neural network,and generating sequences of data values based on the neural network. Byway of example, neural network 340 may be a recurrent network such as aLong-Short Term Memory (LSTM) neural network, and device 110 may trainthe neural network with corpus 330.

Once trained, the weights, biases and other aspects stored in the datastructures of machine learning component may represent a model of thedefined format, wherein the model is not a set of grammatical rules(such as might be present in a generation-based fuzzing technique) butrather a probabilistic model. For instance, system 100 may use neuralnetwork 340 to determine a score (e.g., a numeric value) for a textelement that is related to how frequently the value of the particulartext element followed the same or similar sequences of text elements inthe corpus 330 of HTML documents that were used to train the neuralnetwork. In that regard, the neural network may model the defined formatby providing scores that are related to the likelihood that the value ofa particular text element within a sequence of text elements values willequal a specific value when the sequence conforms with the definedformat. The likelihood may be a function of the values of the other textelements in the sequence and the proximity of the other values to theparticular text element such as, in the case of a recurrent network, thevalues of a given number of text elements that precede the particulartext element. By way of example, after neural network 340 is trainedwith corpus 330 of HTML documents, model 350 may indicate (and thescores returned by the neural network may reflect) that the likelihoodof “e” following “head” is 33% (e.g., as in “<header>”), the likelihoodof “>” is 22% (e.g., as in “<head>”), the likelihood of a space is 11%(e.g., when the word “head” is used in a sentence), the likelihood of“a” is 6% (e.g., as in “headache”), etc. (The example percentagedistributions of the example strings and characters discussed hereinhave been selected for ease of illustration, e.g., they ignore issuessuch as case sensitivity. A large corpus of publicly-accessible HTMLdocuments may yield different probabilities and distributions than thoseset forth herein.)

The system may use the scores to identify portions of a test document tobe modified. For instance, the scores provided by the neural network 340may be used to determine whether a particular text element of testdocument is eligible for mutation. FIG. 4 provides an example of an HTMLtest document. Like nearly all, if not all, HTML documents, testdocument 400 starts with the string 410 (“<!DO”), which corresponds withthe keywords “!DOCTYPE html”. In that regard and as shown in FIG. 5,model 350 may indicate that the likelihood 510 of an HTML documentstarting with “<” is 100%, the likelihood 511 that the next character is“!” is 100%, and the likelihood 512 that the next character is “D” isalso 100%. As a result, neural network 340 may return a relatively highscore for each character of the string “<!D” at the beginning of adocument because the string has relatively low perplexity, e.g., eachcharacter is highly predictable in view of the characters before it.(For the purposes of discussing FIGS. 4 and 5, it is assumed that theneural network 340 is configured to score the next character based on upto five characters that immediately precede it.)

As is also common with many HTML documents, document 400 also containsthe keyword “lang=” followed by “[double quote]en[double quote]” (string420), which indicates that the document is written in English. In thatregard, model 350 may indicate that the likelihood 520 that “=” willfollow a double quote is 35% (e.g., when “lang” is used as a keyword),the likelihood 521 that “u” will follow “[space]lang” is 25% (e.g., whenthe word “language” is used in a sentence), and the likelihood that anyother character will follow [double quote] may be close to zero (andthus not shown in the chart of FIG. 5). As a result, the character afterthe string “[space]lang” may be considered to have relatively moderateperplexity because model 350 indicates that there is a 60% chance itwill be one of two values. As also indicated in FIG. 5, if the nextcharacter after “[space]lang” is “=”, the likelihood of the nextcharacter being a double quote symbol is relatively high, e.g., 88%.Because of the number of HTML documents that contain the string“[space]lang=[double quote]en[double quote]”, the likelihood 523 thatthe character after that would be “e” is significant. However, becausethere are many other potential languages for an HTML document beyondEnglish, “e” may be one of many characters that have a significantlikelihood of following “lang=[double quote]”. As a result, thecharacter after the string “ang=[double quote]” may be considered tohave a relatively moderate perplexity and predictability, and neuralnetwork 340 may thus return a relatively moderate score for thecharacter “e” in the string “lange=[double quote]e”.

FIG. 5 further illustrates the predictability of the character followingthe string 430, e.g., “inter”. The number of popular words that containthe string “inter” may be so numerous that many characters have a smallyet relatively equal likelihood 530 of being next. Therefore, since therelative perplexity of the character following the string “inter” isrelatively high, neural network 340 may return a relatively low scorefor that character.

The system may select text elements of a sequence for modification basedon the scores returned by the neural network. Modifying keywords in adocument may result in an application being unable to parse the documentand may thus cause the application to cease processing the documentaltogether or crash; that may be helpful in some circumstances, but itmay also result in many routines of the application going untested. Asnoted above, keywords tend to be associated with high scores. As aresult and as shown in FIG. 6, the system may designate the characterswithin portions 611 and 612 (containing many keywords) as beingsufficiently predictable to remain unmodified and the characters withinportions 610 (containing one or many possible language codes) and 630(containing text intended for display to users) as being sufficientlyunpredictable to be modified.

The system may determine whether a text element is eligible or not formodification by comparing the text element's score to a threshold. Forinstance, device 110 may iterate through the values of the characters oftest document 400 and, for each character, determine a score based onthe neural network and compare that score to a modification eligibilitythreshold. The modification eligibility threshold may correspond with alikelihood threshold. By way of example and with reference to FIGS. 4and 5, model 350 may indicate that the likelihood of “=” being the nextcharacter after “[space]lang” is 35%, which exceeds a threshold (line550) of 30%. As a result, the score returned by neural network 340 mayexceed a corresponding modification eligibility threshold and, if so,the device 110 may designate the character as ineligible formodification. (Although FIG. 5 indicates a threshold of 30% for ease ofillustration, modification eligibility thresholds associated withlikelihood thresholds of 90% or greater may yield more interestingresults.) However, if the value of the character following “[space]lang”had been “u” instead of “=”, and if the score of “u” was lower than themodification eligibility threshold (e.g., the model indicates that theodds of the character being “u” was relatively unlikely), the device 110may have designated the character as eligible for modification. Thesystem may further designate all portions between portions of highpredictability, such as portions 610 and 630 between portions 611-12 andportions 631-32, respectively, as eligible for modification.

The score and modification eligibility threshold may also be based onfactors that are not specific to the value of the text element. Forinstance, if many character values have a relatively uniform likelihoodof following a particular string, the modification eligibility thresholdmay be lowered, e.g., system 100 may be more likely to designate thecharacter as being eligible for modification. The modificationeligibility threshold may also be dynamically determined. For instance,the threshold may be a randomly determined number. By way of example, acharacter within document 400 may be identified as ineligible formodification when S>Random(0.00-1.00), where S is the score returned byneural network 340 for the character, and the scores and potentialrandom values range between 0.00 to 1.00. As a corollary, the system maydesignate a text element as being eligible for modification whenS>1−Random(0.00-1.00). The score may also be based on the number ofpotential values that are above a minimum threshold or the score of themost-likely value for the text element.

The portions of the document that were designated as eligible formodification may be randomly changed. By way of example and as shown inFIG. 7, the system may generate a modified document by 700 indicating toa mutation-based fuzzing module that portions 610 and 630 are availablefor mutation, e.g., characters may be randomly changed, added ordeleted.

The portions that are eligible for modification may also be selected forreplacement by portions from the same or other documents. For instanceand as shown in FIG. 7, the system has swapped the positions of portions640 and 650. Portions of the test document may also be replaced withportions from other test documents. Moreover, the replacement portiondoes not have to be the same size as the replaced portion, particularlyif the replacement is taken from another document. For example,increasingly larger replacement sequences may be added until a maximumlength is reached or a relatively high perplexity point is reached.

When determining whether a text element should be modified, the systemmay consider not only the preceding text elements but subsequent textelements as well. For example, the FIG. 6 shows string “</head><body>”as a single block 631. However, the model may indicate that thecharacter “b” is relatively unpredictable since it may be highly likelythat a keyword will follow “ead><” but the precise keyword itself may behard to predict. However, once it is known that the value of the nextcharacter is “b”, the model may indicate that the remaining charactersof the block 631 are highly predictable because the tag “<body>” oftenfollows “<head>”. As a result and in some aspects, if a singlelow-scored character is sandwiched between strings of high-scoredcharacters, the system may check whether the lower-scored character andsubsequent high-scored characters form a single keyword.

The system may measure one or more characteristics of a set of computerinstructions' performance as they process the test sequences. By way ofexample and as shown in FIG. 8, device 110 may load test document 700into a browser 810 and generate a report 805 regarding how well thebrowser performed. The report may include the name 811 of the documentand information such as whether loading the document caused particularroutines 820-23 (e.g., routines relating to rendering content, executingjavascript, communicating information over a network and securing data)and third party plug-ins 830-32 to be called and, if so, whether anyerrors occurred. The system may also calculate, and the report may alsoinclude, a test score 815 based on other performance characteristicssuch as the document's coverage (e.g., the number of different routinesthat were called, the total number of unique lines of code that wereexecuted), processing speed (e.g., load times), CPU and memory usage,whether any interesting results were encountered (e.g., errors, securityissues such as buffer overflow errors and decompression bombs, plug-infailure 832, the application crashed, etc.), and any other measurableaspects relating to performance. Different events may be weighteddifferently when calculating a test score.

The performance characteristics may be used to determine whether furthermodifications should be made to the application or document. Forinstance, after the initial test, the document may be modified asdescribed above and tested once again. As shown in FIG. 9, the systemmay then generate a second report 905, which indicates that anadditional routine 921 of the browser and third-party plug-in 931 werecalled. The report also indicates that third-party plugin 930, whichprocessed the prior version of the document without difficulty, failedwith a buffer overflow error that could, in some circumstances, createsecurity issues for data handled by that plug-in. As a result, thecalculated test score 915 of the document increased relative to thefirst report 805. The system may repeat the process of identifyingportions of a document that are eligible for modification based onscores returned by the neural network, modifying the eligible portionsof the document, and determining a test score for the document until thedocument's test score stops increasing. If the defined format is PDF,the system may test a PDF reader, e.g., the functionality of a browserfor displaying PDF documents, a stand-alone PDF application fordisplaying and editing PDF documents, etc.

The system may also be used to generate a completely new set of testdocuments in compliance with the model of the defined format. Forinstance, the system may create a new test document and randomly selectthe value of the text elements based on the likelihood of theiroccurrence as indicated by the model represented by the neural network.By way of example and as shown in part in FIG. 5, model 350 may indicatethat all HTML document in the corpus begin with “<DOCTYPE html”. As aresult, when system 100 uses neural network 340 to randomly generate anew document, the first fourteen characters of the document would be“<DOCTYPE html”. Thereafter, however, the probabilities may change,e.g., the model may indicate that 80% of the time the string “html” isfollowed by a space and 20% of the time it is followed by a “>”. As aresult, the system may randomly select a space or “>” by generating arandom number between 0.00 and 1.00 and determining whether the numberis greater or less than 0.80 and select a space or “>” accordingly asthe next character of the generated document. The remaining charactersof the document may be similarly determined. The randomly-generated testdocuments may be then be modified and tested as described above.

The model may be periodically updated to reflect changes to requirementsand features of the defined format. For instance, neural network 340 maybe periodically trained with recently created documents in order to keepmodel 350 up to date with changes to the defined format. Depending onthe complexity of the defined format and other circumstances, the costand other resources required to train and maintain a neural network suchas neural network 340 may be less than the cost and resources requiredto write and maintain computer programs that create or analyze documentsbased on a rigid set of grammatical rules that were set by the people ororganization that defined the format.

While the use of a recurrent neural network to score text elements maybe particularly advantageous in certain applications, the system may useother components to provide a score that is based on the relationship ofa given sequence of text element values to sequences of text elementvalues that conform with a defined format. For instance, in lieu of arecurrent neural network, the machine learning component may be asupport vector machine trained with N-grams copied from documents thatcomply with the deformed format, or a hidden Markov model. Moreover, inlieu of machine learning, the text-element scoring component may includea statistical regression routine that uses a sequence containing thetext-element as the dependent variable and sequences in the corpus asindependent variables.

FIG. 10 provides a flowchart of a method that may be executed by one ormore computing devices. At block 1010, a sequence of values of textelements is received. At block 1020, a score for a text element value ofthe sequence is determined, where the score with respect to a particulartext element value is related to the probability that the particulartext element value will equal one or more given values, and where theprobability is determined based on sequences of text element values thatare consistent with a defined format. At block 1030, the score iscompared to a threshold. At block 1040, when the score is below athreshold, the value of the text element is modified to form a modifiedsequence of text element values. At block 1050, the modified sequence isprocessed with a set of instructions. At block 1060, a characteristic ofthe performance of the computer instructions is tested by processing themodified sequence with the computer instructions.

As these and other variations and combinations of the features discussedabove can be utilized without departing from the invention as defined bythe claims, the foregoing description of the embodiments should be takenby way of illustration rather than by way of limitation of the inventionas defined by the claims. The provision of examples of the invention (aswell as clauses phrased as “such as,” “e.g.”, “including” and the like)should not be interpreted as limiting the invention to the specificexamples; rather, the examples are intended to illustrate only some ofmany possible aspects. Similarly, references to “based on” and the likemeans “based at least in part on”.

The invention claimed is:
 1. A method comprising: receiving a sequenceof values of text elements; determining, with one or more computingdevices, a score for a text element value of the sequence, where thescore is related to the probability of a particular text element valueequaling one or more given values, where said probability is based onsequences of text element values that are consistent with a definedformat, and where determining the score with respect to the value of theparticular text element in a particular sequence of text elements isrelated to how frequently the value of the particular text elementfollows same or similar sequences of the text element values that areconsistent with the defined format; comparing, with the one or morecomputing devices, the score to a threshold; when the score is below athreshold, modifying, with the one or more computing devices, the valueof the text element to form a modified sequence of text element values;processing, with the one or more computing devices, the modifiedsequence of text element values with a set of instructions; and testing,with the one or more computing devices, a performance characteristic ofthe set of instructions when the set of instructions process themodified sequence of text element values.
 2. The method of claim 1,wherein determining the score comprises determining the score based on arecurrent neural network trained with the sequences of values of textelements that conform with the defined format.
 3. The method of claim 2,wherein the recurrent neural network is a Long-Short Term Memory (LSTM)neural network.
 4. The method of claim 2, wherein the sequences ofvalues of text elements that conform with the defined format areaccessible via the Internet.
 5. The method of claim 4, wherein thedefined format is HTML or PDF.
 6. The method of claim 1, furthercomprising determining a test value based on the performancecharacteristic.
 7. The method of claim 6, further comprising:determining a test score based on the performance characteristic; andcontinuing to determine a test value for a given sequence of textelement values, modify a value of one or more text elements of the givensequence of text element values, and test the performance characteristicof the instructions with the given sequence until the test value exceedsa threshold.
 8. A system comprising: one or more computing devices, anda memory storing instructions executable by the one or more computingdevices, wherein the instructions comprise: receiving an initialsequence of text elements having values; determining a first score forthe value of a first text element of the initial sequence where thefirst score is related to the probability of a particular text elementvalue equaling one or more given values where said probability is basedon sequences of text element values that are consistent with a definedformat, and wherein determining a score with respect to the value of theparticular text element in a particular sequence of text elements isrelated to how frequently the value of the particular text elementfollows same or similar sequences of text element values that areconsistent with the defined format; determining a second score for thevalue of a second text element of the initial sequence, wherein there isa third text element between the first and second text elements in theinitial sequence; comparing the first and second scores to a threshold;when the first and second scores are above the threshold, generating amodified sequence of text elements having values, where the value of afirst text element in the modified sequence equals the value of thefirst text element in the initial sequence, the value of a second textelement in the modified sequence equals the value of the second textelement in the initial sequence, the value of a third text element inthe modified sequence is different from the value of the third textelement in the initial sequence, and the third text element is inbetween the first and second text elements in the sequence; processing,with the one or more computing devices, the modified sequence of textelements with an application; and testing, with the one or morecomputing devices, a performance characteristic of the application whenthe application processes the modified sequence of text element values.9. The system of claim 8, wherein determining a score comprisesdetermining the score based on a recurrent neural network trained withthe sequences of text element values that are consistent with a definedformat.
 10. The system of claim 9, wherein the recurrent neural networkis a Long-Short Term Memory (LSTM) neural network.
 11. The system ofclaim 10, wherein the defined format is PDF, the neural network istrained with PDF documents, and the application comprises a PDF reader.12. The system of claim 8, wherein the instructions further comprise:receiving the modified sequence of text elements having values, themodified sequence including fourth, fifth and sixth text elements, thesixth text element being between the fourth and fifth text elements;determining a fourth score for the value of a fourth text element of themodified sequence, determining a fifth score for the value of a fifthtext element of the modified sequence, comparing the fourth and fifthscores to the threshold; when the first, second, fourth and fifth scoresare above the threshold, modifying the value of the third text elementto match the value of the sixth text element.
 13. The system of claim12, wherein the instructions further comprise modifying the value of thesixth text element to match the value of the third text element.
 14. Asystem comprising: one or more computing devices; a memory storinginstructions executable by the one or more computing devices; whereinthe instructions comprise: receiving a document containing a sequence oftext characters; determining a score for each of a plurality ofcharacters in the sequence of text characters of the document, whereinthe score of a character is determined based on the value of thecharacter, the value of one or more preceding characters in thedocument, and a machine learning component trained with sequences ofcharacters conforming with a defined format, wherein determining thescore with respect to the value of a particular text character in aparticular sequence of text characters is related to how frequently thevalue of the particular text character follows same or similar sequencesof text character values that are consistent with the defined format;when the score of a character below a threshold, associating thecharacter with a set of characters eligible for modification; modifyingat least one of the characters in the set of characters; and aftermodifying at least one of the characters in the set of characters,measuring the performance of an application as the application processesthe document by testing the performance characteristic of theapplication when the application processes the modified one ofcharacters in the set of characters.
 15. The system of claim 14, whereinthe machine learning component comprises a recurrent neural network. 16.The system of claim 15, wherein the recurrent neural network is aLong-Short Term Memory (LSTM) neural network.
 17. The system of claim14, wherein modifying a character comprises replacing the character witha plurality of characters.
 18. The system of claim 14, wherein themodifying a character comprises replacing the character with othercharacters in the set of character.
 19. The system of claim 14, whereinthe score of a character is further based on the value of at least twopreceding characters in the document.
 20. The system of claim 14,wherein the received document is a first document and wherein theinstructions further comprise: generating a second document that is acopy of the first document after the at least one or more charactershave been modified, determining the scores of the characters of thesecond document, modifying at least one character of the second documentbased on the character's score; and depending on the performance of theapplication, generating a third document that is a copy of the seconddocument after the at least one or more characters of the seconddocument have been modified, determining the scores of the characters ofthe third document, modifying at least one character of the thirddocument based on the character's score, and measuring the performanceof the application as the application processes the third document.